package org.tmad.ocms.service;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;
import org.tmad.ocms.dao.CommonDAO;
import org.tmad.ocms.log.LogFactory;

public class MasterDataService {
	private static Logger logger = LogFactory.getLogger();

	/**
	 * Get states from database.
	 * 
	 * @return
	 */
	public static Map<Integer, String> getStates() {
		try {
			return CommonDAO.getStates();
		} catch (Exception e) {
			logger.error("error while fetching states", e);
		}
		return new HashMap<Integer, String>();
	}

	public static Map<Integer, String> getCaseSubCategories(Integer id) {
		try {
			return CommonDAO. getCaseSubCategories(id);
		} catch (Exception e) {
			logger.error("error while fetching case sub categories", e);
		}
		return new HashMap<Integer, String>();
	}

	public static Map<Integer, String> getHelpSubCategories(Integer id) {
		try {
			return CommonDAO.getHelpSubCategories(id);
		} catch (Exception e) {
			logger.error("error while fetching states", e);
		}
		return new HashMap<Integer, String>();
	}

	public static Map<Integer, String> getCaseCategories() {
		try {
			return CommonDAO.getCaseCategories();
		} catch (Exception e) {
			logger.error("error while fetching states", e);
		}
		return new HashMap<Integer, String>();
	}

	public static Map<Integer, String> getHelpCategories() {
		try {
			return CommonDAO.getHelpCategories();
		} catch (Exception e) {
			logger.error("error while fetching states", e);
		}
		return new HashMap<Integer, String>();
	}

}
